﻿using _2._18._2015_MoviesInClass.Adapters;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Mvc;
using Microsoft.Practices.Unity.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using _2._18._2015_MoviesInClass.Data.Models;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using _2._18._2015_MoviesInClass.Data;
using System.Data.Entity;
using _2._18._2015_MoviesInClass.Controllers;

namespace _2._18._2015_MoviesInClass
{
    public class Bootstrapper
    {
        public static IUnityContainer Initialise()
        {
            var container = BuildUnityContainer();
            DependencyResolver.SetResolver(new UnityDependencyResolver(container));
            return container;
        }
        private static IUnityContainer BuildUnityContainer()
        {
            var container = new UnityContainer();
            container.LoadConfiguration();
            // register all your components with the container here  
            //This is the important line to edit  
            //container.RegisterType<IMovieAdapter, MovieDataAdapter>();
            //container.RegisterType<IMovieAdapter, MovieMockAdapter>();
            //container.RegisterType<IMovieAdapter, MovieFBAdapter>();
            container.RegisterType<IUserStore<User>, UserStore<User>>();
            container.RegisterType<UserManager<User>>();
            container.RegisterType<DbContext, MoviesDbContext>();
            container.RegisterType<ApplicationUserManager>();
            container.RegisterType<AccountController>(new InjectionConstructor());
            RegisterTypes(container);
            return container;
        }
        public static void RegisterTypes(IUnityContainer container)
        {

        }
    }  
}